package com.topfinance.cnaps2.ebo;

// Generated 2009-6-19 13:56:29 by Hibernate Tools 3.2.2.GA

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * SysDepartment generated by hbm2java
 */
@Entity
@Table(name = "T_SYS_ORG")
public class SysOrgEbo implements java.io.Serializable {

	//OID	主键	integer	
	private Integer oID;

	//name	名称	varchar2(100)
	private String name;

	//code	部门编码	varchar2(40)
	private String code;

	//PID	上级ID	integer	
	private SysOrgEbo pORG;

	//Desc	备注	varchar2(100)
	private String desc;

	public SysOrgEbo() {
	}

	public SysOrgEbo(Integer oid, String name, String code, String desc) {
		super();
		oID = oid;
		this.name = name;
		this.code = code;
		this.desc = desc;
	}

	@Id
	@Column(name = "ID", unique = true, nullable = false)
	@SequenceGenerator(name = "SYS_ORG_GEN", sequenceName = "S_SYS_ORG")
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "SYS_ORG_GEN")
    public Integer getOID() {
        return this.oID;
    }
    public void setOID(Integer oID) {
        this.oID = oID;
    }

	@Column(name = "name")
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "code")
	public String getCode() {
		return this.code;
	}
	public void setCode(String code) {
		this.code = code;
	}

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "pid")
    public SysOrgEbo getPORG() {
        return this.pORG;
    }
    public void setPORG(SysOrgEbo pORG) {
        this.pORG = pORG;
    }

	@Column(name = "description")
	public String getDesc() {
		if (desc == null)
			return "";
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}

}
